import unittest
import app
from api.login import LoginAPI
from utils import common_assert

class TestLogin(unittest.TestCase):
    def setUp(self):
        self.login_api = LoginAPI()

    def test01_login(self):
        response = self.login_api.login({"mobile": "13800000002", "password": "123456"})
        print(response.json())
        common_assert(self, response)
        app.TOKEN = "Bearer " + response.json().get("data")
        app.headers_data["Authorization"] = app.TOKEN
        print(app.headers_data["Authorization"])